﻿<Window x:Class="QSWPFApplicationCSharp.WcfWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:ValidationFrameworkWPF="clr-namespace:ValidationFramework.WPF;assembly=ValidationFramework"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
    Title="WcfWindow" Height="200" Width="400">
	<Window.Resources>

		<ValidationFrameworkWPF:EnumValueConverter x:Key="enumValueConverter"/>
		<Style TargetType="{x:Type TextBox}" >
			<Setter Property="Validation.ErrorTemplate">
				<Setter.Value>
					<ControlTemplate>
						<Border BorderBrush="Blue" BorderThickness="2">
							<AdornedElementPlaceholder />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style TargetType="{x:Type StackPanel}" >
			<Setter Property="Validation.ErrorTemplate" >
				<Setter.Value>
					<ControlTemplate>
						<Border BorderBrush="Blue" BorderThickness="2">
							<AdornedElementPlaceholder />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>

		</Style>

		<Style TargetType="{x:Type ComboBox}" >
			<Setter Property="Validation.ErrorTemplate" >
				<Setter.Value>
					<ControlTemplate>
						<Border BorderBrush="Blue" BorderThickness="2">
							<AdornedElementPlaceholder />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>

		</Style>

	</Window.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"  />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition  Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<TextBlock Grid.Column="0" Grid.Row="0">Age:</TextBlock>
		<TextBox Grid.Column="1" Grid.Row="0" Name="ageTextBox"/>
		<TextBlock Grid.Column="0" Grid.Row="1">Error Messages:</TextBlock>
		<TreeView Name="errorTreeView" Grid.Row="1" Grid.Column="1"></TreeView>
		<WrapPanel Grid.Column="0" Grid.Row="2" FlowDirection="RightToLeft" Grid.ColumnSpan="2">
			<Button Height="Auto" Width="Auto" Click="closeButton_Click" Content="Close"/>
			<Button Height="Auto" Width="Auto" Click="submitButton_Click" Content="Submit To Service"/>
			<Button Height="Auto" Width="Auto" Click="validateButton_Click" Content="Validate Client Side"/>
		</WrapPanel>
	</Grid>
</Window>
